package com.qf.controller;

import com.qf.entity.User;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;

@RestController
@RequestMapping("/user")
public class UserController {

    @PostMapping("/regist") // 这个接口只能接收post请求，如果在发送get请求，发送方回收到405
    // @RequestBody 的含义：把请求体中的数据（json）转换为 user对象
    public HashMap<String,Object> regist(@RequestBody User user,String abc,String def){
//
        System.out.println(user);
        System.out.println(abc);
        System.out.println(def);
        HashMap<String, Object> hashMap = new HashMap<>();
        hashMap.put("code","-1");
        hashMap.put("msg","error");
        return hashMap;
    }


}
